package com.example.movie.ui.home.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter

class BaseFragmentPagerAdapter(fm: FragmentManager, dataList: MutableList<Fragment>) :
    FragmentPagerAdapter(
        fm,
        BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
    ) {

    private var mDataList: MutableList<Fragment> = dataList

    override fun getItem(position: Int): Fragment {
        return mDataList[position]
    }

    override fun getCount() = mDataList.size
}